package com.atwy.account.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AccountMapper {
    @Update("update account_tbl set money = money - #{money} where user_id = #{userId}")
    int deduct(@Param("userId") String userId, @Param("money") int money);

    @Select("select money from account_tbl where user_id = #{userId}")
    int getMoneyByUserId(@Param("userId")String userId);
}
